<!--#include file="../lib/utf-8.asp"-->
<!--#include file="../lib/asp-json-lib.asp"-->
<!--#include file="../lib/asp-common-lib.asp"-->
<%
Set conn = Server.CreateObject("ADODB.CONNECTION")
db = "Provider=Microsoft.Jet.OLEDB.4.0;data source="&Server.MapPath("..\data\data.mdb")&";Jet OLEDB:Database Password=tp@chenkai"
conn.Open db
Response.ContentType = "application/json"

'先清除由于conn.open而产生的警告以 Errors 集合中的 Error 对象的方式出现，但并不中止程序的执行
conn.errors.clear
'事务开始
conn.BeginTrans
on error resume next 
sql="drop table CURR"
call ExecuteCommand(sql,false)
sql="drop table CD_CURR"
call ExecuteCommand(sql,false)

sql="create table CD_CURR(CD int primary key,CURR int)"
call ExecuteCommand(sql,false)
sql="create table CURR(CURR_CODE int primary key,CURR_NAME varchar)"
call ExecuteCommand(sql,false)

sql="insert into curr(curr_code,curr_name) values(304,'德国马克')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(305,'法国法郎')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(307,'意大利里拉')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(312,'西班牙比赛塔')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(315,'奥地利先令')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(318,'芬兰马克')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(110,'港币')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(112,'印度尼西亚卢比')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(116,'日本元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(121,'澳门元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(122,'马来西亚林吉特')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(129,'菲律宾比索')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(132,'新加坡元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(133,'韩国圆')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(136,'泰国铢')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(142,'人民币')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(143,'新台币')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(300,'欧元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(302,'丹麦克朗')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(303,'英镑')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(326,'挪威克朗')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(330,'瑞典克朗')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(331,'瑞士法郎')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(344,'俄罗斯卢布')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(501,'加拿大元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(502,'美元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(601,'澳大利亚元')"
call ExecuteCommand(sql,false)
sql="insert into curr(curr_code,curr_name) values(609,'新西兰元')"
call ExecuteCommand(sql,false)


sql="insert into ul(ul_cont,ul_post) values('新增导出报表显示报关商品币种选项',0)"
call ExecuteCommand(sql,false)


dim json
set json=jsObject()
if conn.Errors.Count=0 then
    '如果没有conn错误，则执行事务提交
    conn.CommitTrans
    if sql="" then 
        json("bStatus")=false
        json("sInfo")="没有进行任何操作"
    else
        json("bStatus")=true
    end if
else
    '否则回滚
    conn.RollbackTrans
    json("bStatus")=false
    json("sInfo")="数据库错误"
end if
json.Flush
conn.close
set conn=nothing
%>

